package org.dreamfly.netshop.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * GoodsInfo entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "goodsinfo")
public class GoodsInfo implements Serializable {
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne(targetEntity = Type.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "ClassID")
    private Type type;
    @Column(name = "goodsname")
    private String goodsName;
    @Column(name = "goodsintroduce")
    private String goodsIntroduce;
    @Column(name = "goodsbrand")
    private String goodsBrand;
    @Column(name = "goodsunit")
    private String goodsUnit;
    @Column(name = "goodsweight")
    private Double goodsWeight;
    @Column(name = "goodsurl")
    private String goodsUrl;
    @Column(name = "marketprice")
    private Double marketPrice;
    @Column(name = "memberprice")
    private Double memberPrice;
    @Column(name = "isrefinement")
    private boolean refinement;
    @Column(name = "ishot")
    private boolean hot;
    @Column(name = "adddate")
    private Date addDate;
    @Column(name = "isdiscount")
    private boolean discount;
    @Column(name = "postage")
    private Double postage;

    @OneToMany(targetEntity = ShopCart.class, mappedBy = "goodsInfo")
    private Set<ShopCart> shopCarts = new LinkedHashSet<ShopCart>(0);

    // Constructors

    /** default constructor */
    public GoodsInfo() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsIntroduce() {
        return goodsIntroduce;
    }

    public void setGoodsIntroduce(String goodsIntroduce) {
        this.goodsIntroduce = goodsIntroduce;
    }

    public String getGoodsBrand() {
        return goodsBrand;
    }

    public void setGoodsBrand(String goodsBrand) {
        this.goodsBrand = goodsBrand;
    }

    public String getGoodsUnit() {
        return goodsUnit;
    }

    public void setGoodsUnit(String goodsUnit) {
        this.goodsUnit = goodsUnit;
    }

    public Double getGoodsWeight() {
        return goodsWeight;
    }

    public void setGoodsWeight(Double goodsWeight) {
        this.goodsWeight = goodsWeight;
    }

    public String getGoodsUrl() {
        return goodsUrl;
    }

    public void setGoodsUrl(String goodsUrl) {
        this.goodsUrl = goodsUrl;
    }

    public Double getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(Double marketPrice) {
        this.marketPrice = marketPrice;
    }

    public Double getMemberPrice() {
        return memberPrice;
    }

    public void setMemberPrice(Double memberPrice) {
        this.memberPrice = memberPrice;
    }

    public boolean getRefinement() {
        return refinement;
    }

    public void setRefinement(boolean refinement) {
        this.refinement = refinement;
    }

    public boolean getHot() {
        return hot;
    }

    public void setHot(boolean hot) {
        this.hot = hot;
    }

    public Date getAddDate() {
        return addDate;
    }

    public void setAddDate(Date addDate) {
        this.addDate = addDate;
    }

    public boolean getDiscount() {
        return discount;
    }

    public void setDiscount(boolean discount) {
        this.discount = discount;
    }

    public Set<ShopCart> getShopCarts() {
        return shopCarts;
    }

    public void setShopCarts(Set<ShopCart> shopCarts) {
        this.shopCarts = shopCarts;
    }

    public Double getPostage() {
        return postage;
    }

    public void setPostage(Double postage) {
        this.postage = postage;
    }

}